Data and Functions

Packages and Functions

library(Rcpp)
library(ggplot2)
library(plotly)
library(data.table)
library(ggpubr)
library(vegan)
library(phyloseq)
# devtools::install_github("schuyler-smith/schuylR")
library(schuylR)
# devtools::install_github("schuyler-smith/ssBLAST")
library(ssBLAST)
setwd('~/google-drive/DARTE/')
sourceCpp('src/fasta_seq_names.cpp')
# sourceCpp('src/fasta_merge.cpp')
# sourceCpp('src/parse_blast.cpp')
# sourceCpp('src/BLAST_db_match.cpp')
# sourceCpp('src/process_BLAST.cpp')


Data Files

metadata <- fread('files/DARTE-QM-v3-metadata-fromKathyMou.csv')
  metadata[[1]] <- gsub('\\.', '_', metadata[[1]])
categories <- fread('files/category_all.tsv', header = FALSE)
  colnames(categories) <- c('Source', 'ARG_Class', 'Primer')


Sequencing Results


Percent Identity

This is created by averaging the number of reads from all samples from a single source, i.e. the average number of reads aligned from soil at each percent identity threshold.


Relative Abundance

This is the same information as the Percent Identity graph, but represented as the proportion of the total number of reads from the raw FASTQ files.


Percent Aligned

This is the same information as the Percent Identity graph, but represented as the proportion of the total number of aligned reads. I.E. at each increasing percent identity, the number of reads aligned is divided by the number of reads aligned at 60% (the total number of aligned reads).


98% Identity match for reads of length >= 100 bp seems to be the ideal threshold for number of reads captured compared to confidence in alignment. For subsequent analyses, I used that threshold for determining identified ARGs.


Spike Detection


Bar Graphs

spike_counts_table
##                         Sample Spike Spike_Level
##  1:           Q3_Mock_0spike_A     0      0.0000
##  2:           Q3_Mock_0spike_B     0      0.0000
##  3:           Q3_Mock_0spike_C     1      0.0000
##  4:      Q3_Mock_0_0025spike_A    20      0.0025
##  5:      Q3_Mock_0_0025spike_B    11      0.0025
##  6:      Q3_Mock_0_0025spike_C    12      0.0025
##  7:       Q3_Mock_0_009spike_A    37      0.0090
##  8:       Q3_Mock_0_009spike_B    70      0.0090
##  9:       Q3_Mock_0_009spike_C    87      0.0090
## 10:       Q3_Mock_0_025spike_A   223      0.0250
## 11:       Q3_Mock_0_025spike_B   160      0.0250
## 12:       Q3_Mock_0_025spike_C     3      0.0250
## 13: Q3_SCI_Manure_0_025spike_A   465      0.0250
## 14: Q3_SCI_Manure_0_025spike_B   598      0.0250
## 15: Q3_SCI_Manure_0_025spike_C   512      0.0250
## 16:        Q3_Mock_0_12spike_A   633      0.1200
## 17:        Q3_Mock_0_12spike_B   564      0.1200
## 18:        Q3_Mock_0_12spike_C   977      0.1200
## 19:        Q3_Mock_0_25spike_A  2030      0.2500
## 20:        Q3_Mock_0_25spike_B  1686      0.2500
## 21:        Q3_Mock_0_25spike_C  1054      0.2500
##                         Sample Spike Spike_Level

Linear Relation


Mock Samples - ARG Amplicon Detection


Each primer/ARG genes presented is expected to be found based on the mock.expected.fa file. 75% of the primers expected to bind genes in the mock samples were successful, and detected in the sequencing. 87% of the ARG genes expected to be found in the mock samples were found.


ARGs in Mock

BLAST against mock.expected.fa, compare to mock.expected.fa. Looking to see how many of the known ARGs are detected. Something is wrong with Q3_Mock_0_025spike_C.

By Primer

Same data, but by individual primer pressence.


Primer Success

Overall Success

The rate of success for the primers can be determined by how many successfully amplified their intended target.

primer_success
## [1] 26.4



Mock Samples

That metric for success, however, is not necessarily fair; the primers were not made with the certainty that every target was present within any of the samples. The Mock communities were designed with known members, and thereby an idea of the expected targets that would be amplified.

primer_success
## [1] 74.5

Of the 98 genes expected to be found in the Mock communities, 73 were captured by the primers.


Unexpected

I addition to the 73 genes that were expected, there were an additional 61 genes detected that we did not predict.

unexpected
## [1] 61

Unexpected_graph

I addition to the 73 genes that were expected, there were an additional 61 genes detected that we did not predict. The notable is the ?sulfanomides? that we did not expect to be there, as well as the aph-6 and the lnu_C. The other odditty is how much more abundant these are than the expected. Max value of 15000, compared to ~2500.

Of the 97 genes expected to be found in the Mock communities, 72 were captured by the primers.


Sample Ordination


Non-Normalized PCA

Distances were calculated from raw read counts to compare to how normalizing with relative abundance clusters replicates. Without housekeeping genes, we can’t directly compare samples to each other in terms of abundance or expression of certain genes. With relative abundance though, we should be able to compare the ratios.


Normalized PCA

Using relative abundance to normalize samples clusters the replicates tighter, indicating that it works well overall as a normalization method.


NMDS


Hierarchical Clustering


Bray-Curtis


Jaccard


Euclidean


Gower


K-Means Clustering


Optimize K


K(4)



K(7)



K(13)



Sample Compositon


ARG Profile



NGS vs PCR